#include <iostream>
#include <vector>
#include <sstream>
using namespace std;

int pivotIndex(vector<int> nums)
{
    int sum = 0; // 求和
    int total = 0;
    for (vector<int>::iterator it = nums.begin(); it != nums.end(); it++)
    {
        sum += *it;
    }
    for (int i = 0; i < nums.size(); i++)
    {
        total = nums[i];
        if (total == sum)
            return i;
        else
        {
            sum -= nums[i];
        }
    }
    return -1;
}
int main()
{
    vector<int> nums;
    int num;

    while (cin>> num) // 回车结束 仅会记入数字
    {
        nums.push_back(num);
    }
    cout << pivotIndex(nums);
}